﻿/*
 * Created by SharpDevelop.
 * User: jnava
 * Date: 12/15/2011
 * Time: 12:17 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;

namespace NppPluginNET
{
	/// <summary>
	/// Description of frmConfigure.
	/// </summary>
	public partial class frmConfigure : Form
	{
		string iniFilePath = string.Empty;
		PluginBase pluginBase;
		
		public frmConfigure(PluginBase plgBase)
		{
			pluginBase = plgBase;
            
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
            txtCoffeeDir.Text = global.coffeeExecDir;
		}
		
		void BtnBrowseClick(object sender, EventArgs e)
		{
			dlgFolderBrowse.ShowDialog();
			if (!string.IsNullOrEmpty(dlgFolderBrowse.SelectedPath))
				txtCoffeeDir.Text = dlgFolderBrowse.SelectedPath;
		}
		
		void BtnSaveClick(object sender, EventArgs e)
		{
			// Win32.WritePrivateProfileString("Configuration", "CoffeeDir", txtCoffeeDir.Text, iniFilePath);
			global.coffeeExecDir = txtCoffeeDir.Text;
			this.Close();
		}
		
		void BtnCancelClick(object sender, EventArgs e)
		{
			this.Close();
		}
	}
}
